<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%  
    String path = request.getContextPath();  
    String basePath = request.getScheme() + "://"  
            + request.getServerName() + ":" + request.getServerPort()  
            + path + "/";  
%>  
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<link	href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css"	rel="stylesheet">
<script type="text/javascript"	src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script	src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${path}/static/test.yt"></script>
<title>编辑用户</title>

<script type="text/javascript">
	function goList(){
		window.location.href="<%=basePath %>user/userInfo";
	}
    function updateUser() {
        var form = document.forms[0];
        form.action = "<%=basePath %>user/updateUser";
        form.method = "post";
        form.submit();
    }
</script>

</head>
<body>
    <div class="container">
		<!-- 标题 -->
		<div class="row">
			<div class="col-md-12">
				    <h1>编辑用户</h1>
			</div>
		</div>
	<div class="row">
			<div class="col-md-12">
    <hr>
    <form action="" name="userForm">
        <input type="hidden" name="id" value="${user.id }" /> 姓名：<input
            type="text" name="name" value="${user.name }" /> <br/>年龄：<input
            type="text" name="age" value="${user.age }" /><br/> 密码：<input
            type="text" name="password" value="${user.password }" />
            <br/><br/><input type="button" class="btn btn-primary"
            value="编辑" onclick="updateUser()" />  <input type="button" class="btn btn-primary"
            value="返回"  onclick="goList()" />
    </form>
    </div></div>
</body>

</html>